<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			window.onload = function() {
				var div = document.getElementsByTagName("div")[0];
				div.addEventListener("click", function() {
					//div.style.backgroundColor = "pink";
					this.style.backgroundColor = "pink";
				});
				div.addEventListener("click", function() {
					div.style.height = "400px";
				});
				
				div.addEventListener("mousemove", f1);
				div.addEventListener("mousemove", f2);
				
			}
			
			function f1() {
             	console.log("f11111");
         	}
			 
         	function f2() {
             	console.log("f22222");
         	}
         	
         	function cancel() {
         		var div = document.getElementsByTagName("div")[0];
				div.removeEventListener("mousemove", f1);
				div.removeEventListener("mousemove", f2);
         	}
		</script>
	</head>
	<body>
		<div style="width:300px;height: 200px;background-color: red;"></div>
      	<input type="button" value="取消" onclick="cancel();"/>
	</body>
</html>
